/**
 * 将表头写在这个位置
 * @author Yuanao
 * @date 2021年11月11日 14:37:36
 */
function writeHtmlAsHead(title){
    /*对标题栏进行处理*/
    if (title == "" || title == undefined || title == null) {
        title = "主页";
    }

    /*对用户进行处理*/
    let userJsonStr = localStorage.getItem("user");
    let user = null;
    if ( userJsonStr != undefined && userJsonStr != null && userJsonStr  != "") {
        user = JSON.parse(userJsonStr);
    }

    let  str = '<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">\n' +
        '        <div class="top-area">\n' +
        '            <div class="container">\n' +
        '                <div class="row">\n' +
        '                    <div class="col-sm-6 col-md-6">\n' +
        '                        <p class="bold text-left">周一 至 周日, 8:00 - 18:00 </p>\n' +
        '                    </div>\n' +
        '                    <div class="col-sm-6 col-md-6">\n' +
        '                        <p class="bold text-right">资讯电话:139红酒白酒葡萄酒</p>\n' +
        '                    </div>\n' +
        '                </div>\n' +
        '            </div>\n' +
        '        </div>\n' +
        '        <div class="container navigation">\n' +
        '\n' +
        '            <div class="navbar-header page-scroll">\n' +
        '                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">\n' +
        '                    <i class="fa fa-bars"></i>\n' +
        '                </button>\n' +
        '                <a class="navbar-brand" href="/index.html">\n' +
        '                    <img src="/img/logo.png" alt="" width="150" height="40"/>\n' +
        '                </a>\n' +
        '            </div>\n' +
        '\n' +
        '            <!-- 导航栏 -->\n' +
        '            <div class="navbar-collapse navbar-right navbar-main-collapse">\n' +
        '                <ul class="nav navbar-nav">\n' +
        '                    <li '+ (title === "主页" ? ' class="active"' : "" ) +'><a href="/index.html">主页</a></li>\n' +
        '                    <li '+ (title === "在线预约" ? ' class="active"' : "" ) +'><a href="/page/book/onlineBooking.html">在线预约</a></li>\n' +
        '                    <li '+ (title === "药品查询" ? ' class="active"' : "" ) +'><a href="/page/drug/drugSearch.html">药品查询</a></li>\n' +
        '                    <li '+ (title === "新闻" ? ' class="active"' : "" ) +'><a href="/page/news/newsList.html">新闻</a></li>\n' +
        //处理用户名
                             (
                                 user == null ? '<li><a href="/page/login.html">登录</a></li>\n' :
            '                    <li class="dropdown">\n' +
            '                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span\n' +
            '                                class="badge custom-badge red pull-right"></span>'+user.name+'<b class="caret"></b></a>\n' +
            '                        <ul class="dropdown-menu">\n' +
            '                            <li><a href="/page/user/bookManage.html">我的预约</a></li>\n' +
            '                            <li><a href="/page/logout.html">退出登录</a></li>\n' +
            '                        </ul>\n' +
            '                    </li>\n'
                             ) +
        '                </ul>\n' +
        '            </div>\n' +
        '            <!-- /.navbar-collapse -->\n' +
        '        </div>\n' +
        '        <!-- /.container -->\n' +
        '    </nav>';

    document.write(str);
}

/**
 * 写入首页的页脚
 * @author Yuanao
 * @date 2021年11月11日14:36:47
 */
function writeHtmlAsFooter(){
    let str = '<footer>\n' +
        '        <div class="container">\n' +
        '            <div class="row">\n' +
        '                <div class="col-sm-6 col-md-4">\n' +
        '                    <div class="wow fadeInDown" data-wow-delay="0.1s">\n' +
        '                        <div class="widget">\n' +
        '                            <h5>关于 twentyTwoK</h5>\n' +
        '                            <p>\n' +
        '                                twentyTwoK 是一个非常优秀的小组,他们都非常团结,他们都是好样的\n' +
        '                            </p>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                    <div class="wow fadeInDown" data-wow-delay="0.1s">\n' +
        '                        <div class="widget">\n' +
        '                            <h5>友情链接</h5>\n' +
        '                            <ul>\n' +
        '                                <li><a href="#">HospitalSystem22K</a></li>\n' +
        '                                <li><a href="#">bootstrap</a></li>\n' +
        '                                <li><a href="#">JQuery</a></li>\n' +
        '                                <li><a href="https://www.baidu.com">百度地图</a></li>\n' +
        '                            </ul>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>\n' +
        '                <div class="col-sm-6 col-md-4">\n' +
        '                    <div class="wow fadeInDown" data-wow-delay="0.1s">\n' +
        '                        <div class="widget">\n' +
        '                            <h5>医疗中心</h5>\n' +
        '                            <p>\n' +
        '                                22K战地医疗创建于2021年11月8号,历史悠久,有专业的设备,会是你专业之选\n' +
        '                            </p>\n' +
        '                            <ul>\n' +
        '                                <li>\n' +
        '                    <span class="fa-stack fa-lg">\n' +
        '                  <i class="fa fa-circle fa-stack-2x"></i>\n' +
        '                  <i class="fa fa-calendar-o fa-stack-1x fa-inverse"></i>\n' +
        '                  </span> 周一 至 周日, 8:00 - 18:00\n' +
        '                                </li>\n' +
        '                                <li>\n' +
        '                    <span class="fa-stack fa-lg">\n' +
        '                    <i class="fa fa-circle fa-stack-2x"></i>\n' +
        '                <i class="fa fa-phone fa-stack-1x fa-inverse"></i>\n' +
        '                </span> +86 (0371) 红酒白酒葡萄酒\n\n' +
        '                                </li>\n' +
        '                                <li>\n' +
        '                    <span class="fa-stack fa-lg">\n' +
        '                  <i class="fa fa-circle fa-stack-2x"></i>\n' +
        '                  <i class="fa fa-envelope-o fa-stack-1x fa-inverse"></i>\n' +
        '                </span> admin@twentyTwoK.com\n' +
        '                                </li>\n' +
        '\n' +
        '                            </ul>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>\n' +
        '                <div class="col-sm-6 col-md-4">\n' +
        '                    <div class="wow fadeInDown" data-wow-delay="0.1s">\n' +
        '                        <div class="widget">\n' +
        '                            <h5>我的位置</h5>\n' +
        '                            <p>中国·河南·郑州 郑州市二七区航海路海为科技园C区12楼海为科技园</p>\n' +
        '\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                    <div class="wow fadeInDown" data-wow-delay="0.1s">\n' +
        '                        <div class="widget">\n' +
        '                            <h5>订阅我们</h5>\n' +
        '                            <ul class="company-social">\n' +
        '                                <li class="social-facebook"><a href="#"><i class="fa fa-facebook"></i></a></li>\n' +
        '                                <li class="social-twitter"><a href="#"><i class="fa fa-twitter"></i></a></li>\n' +
        '                                <li class="social-google"><a href="#"><i class="fa fa-google-plus"></i></a></li>\n' +
        '                                <li class="social-vimeo"><a href="#"><i class="fa fa-vimeo-square"></i></a></li>\n' +
        '                                <li class="social-dribble"><a href="#"><i class="fa fa-dribbble"></i></a></li>\n' +
        '                            </ul>\n' +
        '                            <a href="https://yuanao.top">https://www.yuanao.top</a>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>\n' +
        '            </div>\n' +
        '        </div>\n' +
        '        <div class="sub-footer">\n' +
        '            <div class="container">\n' +
        '                <div class="row">\n' +
        '                    <div class="col-sm-6 col-md-6 col-lg-6">\n' +
        '                        <div class="wow fadeInLeft" data-wow-delay="0.1s">\n' +
        '                            <div class="text-left">\n' +
        '                                <p>&copy;HospitalSystem22K - 保留所有权利.</p>\n' +
        '                            </div>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                    <div class="col-sm-6 col-md-6 col-lg-6">\n' +
        '                        <div class="wow fadeInRight" data-wow-delay="0.1s">\n' +
        '                            <div class="text-right">\n' +
        '                                <div class="credits">版权所有 &copy; 2021. HospitalSystem22K保留版权所有.\n' +
        '                                </div>\n' +
        '                            </div>\n' +
        '                        </div>\n' +
        '                    </div>\n' +
        '                </div>\n' +
        '            </div>\n' +
        '        </div>\n' +
        '    </footer>';

    document.write(str);
}

